package library;

public class Book {
    private String name;    //书名
    private String author;  //作者
    private double price;   //价格
    private String type;    //类型
    private boolean isBorrow = false;   //是否借出
    //构造函数
    public Book(String name, String author, double price, String type) {
        this.name = name;
        this.author = author;
        this.price = price;
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public String getAuthor() {
        return author;
    }

    public double getPrice() {
        return price;
    }

    public String getType() {
        return type;
    }

    public boolean isBorrow() {
        return isBorrow;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public void setType(String type) {
        this.type = type;
    }

    public void setBorrow(boolean borrow) {
        isBorrow = borrow;
    }

    @Override
    public String toString() {
        return "[" + name + ", " + author + ", " + price + ", " //
                + type + ", " + (isBorrow ? "已借出" : "未借出") + "]";
    }
}
